import {
  customerService
} from '../../apis/user';
const app = getApp();

Page({
  data: {
    list: [],
    popupShow: false,
    details: {}
  },

  onLoad() {
    this.getCustomerService();
  },

  getCustomerService() {
    customerService().then(res => {
      if (res.data.code === 200) {
        let {
          rows
        } = res.data;
        this.setData({
          list: rows
        });
      };
    });
  },

  showPopup(e) {
    let {
      index
    } = e.currentTarget.dataset;
    this.setData({
      details: this.data.list[index],
      popupShow: true
    });
  },

  hidePopup() {
    this.setData({
      popupShow: false
    });
  },

  emptyFunction() {}
})